<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue测试</title>
  <style>
    .pane {
      width: 100px;
      height: 100px;
      background-color: bisque;
    }
  </style>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <h1>用户名:{{username}}</h1>
    <h3 v-if="isVip">用户类型：VIP</h3>
    <button @click="showPane">切换显示</button>
    <div class="pane" v-show="isShow"></div>
  </div>
  <script type="text/javascript">
    var app = new Vue({
      el: '#app',
      data: {
        username: '瓜子喵',
        isVip: true,
        isShow: false
      },
      methods: {
        showPane(e) {
          console.log(e)
          this.isShow = !this.isShow
        }
      }
    })
  </script>
</body>

</html>